home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 …ember: Reference Library / Dev.CD Dec 96 RL / Dev.CD Dec 96 RL.toast / Technical Documentation / develop / develop Issue 27 / develop Issue 27 code / Internet Config Assistant / toolkit / TEnvironment.h < prev   
Encoding:
C/C++ Source or Header  |  1996-06-30  |  1.1 KB  |  54 lines  |  [TEXT/CWIE]

  1. /*
  2.   File:            TEnvironment.h
  3.  
  4.   Contains:        
  5.  
  6.   Written by:    Arno Gourdol
  7.  
  8.   Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #include <Types.h>
  13. #include <Gestalt.h>
  14.  
  15. #include "CRect.h"
  16.  
  17. class TEnvironment
  18. {
  19. public:
  20.     TEnvironment(void);
  21.     ~TEnvironment() {};
  22.     
  23.     inline Boolean HasGestaltAttribute(OSType selector, UInt32 attribute);
  24.     
  25.     Boolean HasColorQuickdraw(void);
  26.     Boolean HasAppleEvent(void);
  27.     Boolean HasGestalt(void);
  28.     Boolean HasExtendedDITL(void);
  29.     
  30.     void GetMonitorRect(const CRect& r,
  31.                         CRect& monitor);            // Returns the monitor rectangle covering most of r
  32.     void GetMainScreenRect(CRect& theMainScreenRect);// Returns the rectangle of the main screen
  33.     Boolean IsSystemScriptRTL(void);
  34.     
  35. private:
  36.     enum Tristate {triTrue, triFalse, triUnknown};
  37.     UniversalProcPtr    fUnimplementedTrapAddress;
  38.  
  39.     Tristate    fHasColorQuickdraw;
  40.     Tristate    fHasAppleEvent;
  41.     Tristate    fHasGestalt;
  42.     Tristate    fHasExtendedDITL;
  43.     Tristate    fSystemScriptIsRTL;
  44. };
  45.  
  46.  
  47. Boolean TEnvironment::HasGestaltAttribute(OSType selector, UInt32 attribute)
  48. {
  49.     SInt32 response;
  50.     
  51.     return (::Gestalt(selector, &response) == noErr) && 
  52.         ((response & (1L << attribute)) != 0);
  53. }
  54.